package com.hnjz.bkd;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hnjz.common.JsonResultUtil;
import com.hnjz.common.util.LogUtil;
import com.hnjz.sys.role.RoleForm;

@Controller
public class PersonController {
	
	 /**日志*/
    private static final Log log = LogFactory.getLog(PersonController.class);
    
    @Autowired
    private BkdRyxxManager      bkdRyxxManager;
    
    @RequestMapping(value = "/addPerson.htm")
    public String roleList(ModelMap model) {
        return "bkd/addPerson.jsp";
    }
    /**
     * 保存一个角色信息
     * 
     * @param model {@link ModelMap}
     * @param funForm  角色管理的form表单
     * @return 角色管理的初始界面
     */
    @RequestMapping(value = "/savePerson.json", produces = "application/json")
    public void savePerson(ModelMap model, RoleForm frm) {
        try {
            if (log.isDebugEnabled()) {
                log.debug("表单信息:" + LogUtil.m(frm));
            }
            //roleManager.saveRole(frm);
            bkdRyxxManager.queryBkdRyxx("");
            JsonResultUtil.suncess(model, "保存成功！");
        } catch (Exception e) {
            log.error("保存信息错误：", e);
            JsonResultUtil.fail(model, e.getMessage());
        }
    }

}
